﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Linq;

namespace ConsoleApp
{
    public class ReflectionGetLinq
    {
        /*
         获取System.Linq.Dynamic.dll
         IQueryable<>.GetType().GetMethod("ToTraceString").Invoke(IQueryable<>,null).ToString()；

         */
        public void Test()
        {
            var assembly = Assembly.LoadFrom(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Core.dll");
            var type= assembly.GetType();
            var ToTraceString= type.GetMethod("ToTraceString");

            foreach (var method in type.GetMethods())
            {
                Console.WriteLine($"方法：{method.Name}");
            }
        }
        
    }
}
